<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:v="http://corejsf.com/validator">

<f:view>
<f:loadBundle var="text" basename="#{glryForm.bundleName}"/>
    <head>
        <title>#{text['glryDetail.title']}</title>
        
        <meta name="heading" content="#{text['glryDetail.heading']}"/>
        <style type="text/css">
            .jscalendar-DB-div-style {
                position: absolute;
                margin-top: -120px;
                margin-left: -508px;
            }
    </style>
        
     
     <link rel="stylesheet" type="text/css" href="/corpcredit/styles/tipstyle/tips.css" /> 
     
     
 <script type='text/javascript' src='/corpcredit/dwr/interface/Dwrs.js'></script>
  <script type='text/javascript' src='/corpcredit/dwr/engine.js'></script>
  
   <script type='text/javascript' src='/corpcredit/dwr/interface/LookupManager.js'></script>
  <script type='text/javascript' src='/corpcredit/dwr/engine.js'></script>
  
<script type='text/javascript' src='/corpcredit/dwr/util.js'></script>
<script type="text/javascript">

function my()
{
	this.data = 'one';
	this.change = mychange;
	}
function mychange()
{
	this.data = 'two';
}
   function beforeSave()
   {
	  Dwrs.test(invoke);
	  getTips();
	   return false;
   }

   function sf()
   {
	   a = 2;
	   glo='ffffff';
   }
   function invoke(result)
   {
	  var m = new my();
	   if(result=='available')
	   {
		    alert('available');
		    var tips=$('tips');
		    tips.innerHTML=result;
			m.mychange();
			alert(m.data);

	   }else
	   {
		   alert('not available');
		   var tips=$('tips');
		   tips.innerHTML=result;
			m.mychange();
			alert(m.data);
		  
	   }
   }

   function getTips()
   {
		if(a == 2)
	   	alert(glo);
   }

   function leaving(inpu)
   {
   	var inp=inpu.value;
   	if(inp==null||inp=='')
   	{
   		$('tips').style.display='block';
   		$('tips').innerHTML='人员ID不能为空 ';
   		return ;
   	}else
   	{
   		LookupManager.findByRyid('Glry',inp,invoke2);
   	}
   }
   
   function invoke2(result)
   {
	   if(result=='none')
	   {
		   $('tips').style.display='none';
	   }else
	   {
		   $('tips').style.display='block';
		   $('tips').innerHTML=result;
		   $('glryForm:ryid').value='';
	   }
   }

   
  
</script>

    </head>
<body id="glryForm">

<h:form id="glryForm" onsubmit="return validateGlryForm(this)">


<h:inputHidden value="#{glryForm.glry.id}" id="id"/>
<h:inputHidden value="#{glryForm.glry.version}" id="version"/>

<div id="tips" class="tipclass" style="display: none; ">
this is tips area
</div>
<h:panelGrid columns="6">
  
    <h:outputLabel styleClass="desc" for="csrq" value="#{text['glry.csrq']}"/>
    <t:message for="csrq" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="csrq" value="#{glryForm.glry.csrq}" required="false" maxlength="20">
    </h:inputText>
   
   
    <h:outputLabel styleClass="desc" for="qtqk" value="#{text['glry.qtqk']}"/>
    <t:message for="qtqk" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="qtqk" value="#{glryForm.glry.qtqk}" required="false" maxlength="500">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="ryid" value="#{text['glry.ryid']}"/>
    <t:message for="ryid" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="ryid" onchange="leaving(this);"  value="#{glryForm.glry.ryid}" required="true" maxlength="255">
        <v:commonsValidator type="required" arg="#{text['glry.ryid']}"/>
    </h:inputText>
    <h:outputLabel styleClass="desc" for="sfgd" value="#{text['glry.sfgd']}"/>
    <t:message for="sfgd" styleClass="fieldError"/>
    <h:selectBooleanCheckbox value="#{glryForm.glry.sfgd}" id="sfgd" styleClass="checkbox"/>
    <h:outputLabel styleClass="desc" for="sjcg" value="#{text['glry.sjcg']}"/>
    <t:message for="sjcg" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="sjcg" value="#{glryForm.glry.sjcg}" required="false" maxlength="255">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="username" value="#{text['glry.username']}"/>
    <t:message for="username" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="username" value="#{glryForm.glry.username}" required="false" maxlength="50">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="xb" value="#{text['glry.xb']}"/>
    <t:message for="xb" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="xb" value="#{glryForm.glry.xb}" required="false" maxlength="2">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="xmmc" value="#{text['glry.xmmc']}"/>
    <t:message for="xmmc" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="xmmc" value="#{glryForm.glry.xmmc}" required="false" maxlength="50">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="zgxl" value="#{text['glry.zgxl']}"/>
    <t:message for="zgxl" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="zgxl" value="#{glryForm.glry.zgxl}" required="false" maxlength="20">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="zjhm" value="#{text['glry.zjhm']}"/>
    <t:message for="zjhm" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="zjhm" value="#{glryForm.glry.zjhm}" required="false" maxlength="30">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="zjlx" value="#{text['glry.zjlx']}"/>
    <t:message for="zjlx" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="zjlx" value="#{glryForm.glry.zjlx}" required="false" maxlength="10">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="zw"  value="#{text['glry.zw']}"/>
    <t:message for="zw" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="zw" value="#{glryForm.glry.zw}" required="true" maxlength="50">
        <v:commonsValidator type="required" arg="#{text['glry.zw']}"/>
    </h:inputText>
</h:panelGrid>

  <h:panelGroup styleClass="buttonBar bottom">
        <h:commandButton value="#{text['button.save']}" action="#{glryForm.save}"  id="save" styleClass="button"/>

        <c:if test="${not empty glryForm.glry.id}">
        <h:commandButton value="#{text['button.delete']}" action="#{glryForm.delete}"
            id="delete" styleClass="button" onclick="bCancel=true; return confirmDelete('Glry')"/>
        </c:if>
        <h:commandButton value="#{text['button.cancel']}" action="cancel" immediate="true"
            id="cancel" styleClass="button" onclick="bCancel=true"/>
    </h:panelGroup>

</h:form>

<v:validatorScript functionName="validateGlryForm"/>

<script type="text/javascript">
    //Form.focusFirstElement($('glryForm'));
    highlightFormElements();
</script>

</body>
</f:view>
</html><!--

#################################
onclick="return beforeSave();"

<input value="clic" type="button" onclick="return beforeSave();"/>


 <h:outputLabel styleClass="desc" for="operation" value="#{text['glry.operation']}"/>
    <t:message for="operation" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="operation" value="#{glryForm.glry.operation}" required="false" maxlength="20">
    </h:inputText>
    <h:outputLabel styleClass="desc" for="optdate" value="#{text['glry.optdate']}"/>
    <t:message for="optdate" styleClass="fieldError"/>
    <h:inputText styleClass="text medium" id="optdate" value="#{glryForm.glry.optdate}" required="false" maxlength="23">
    </h:inputText>

  <h:outputLabel styleClass="desc" for="id" value="#{text['glry.id']}"/>
    <h:inputText styleClass="text medium" id="id" value="#{glryForm.glry.id}" required="true">
        <v:commonsValidator type="required" arg="#{text['glry.id']}"/>
    </h:inputText>
    <t:message for="id" styleClass="fieldError"/>
    
     <h:selectOneMenu value="#{glryForm.glry.glryCwfzr}" id="glryCwfzr" required="false" styleClass="select">
        <f:selectItems value="#{glryForm.glry.glryCwfzr}"/>
    </h:selectOneMenu>
    <h:selectOneMenu value="#{glryForm.glry.glryFddbr}" id="glryFddbr" required="false" styleClass="select">
        <f:selectItems value="#{glryForm.glry.glryFddbr}"/>
    </h:selectOneMenu>
    <h:selectOneMenu value="#{glryForm.glry.glryZyjyglr}" id="glryZyjyglr" required="false" styleClass="select">
        <f:selectItems value="#{glryForm.glry.glryZyjyglr}"/>
    </h:selectOneMenu>
    <h:selectOneMenu value="#{glryForm.glry.jbqk}" id="jbqk" required="false" styleClass="select">
        <f:selectItems value="#{glryForm.glry.jbqk}"/>
    </h:selectOneMenu>
-->